package com.xbongbong.pro.enums.lowcode;

import com.xbongbong.paas.constant.PaasConstant;
import lombok.Getter;
import org.springframework.lang.Nullable;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 吴峰
 * @date 2021/03/18 10:35
 */
@Getter
public enum LowCodeExecuteServiceEnum {

    /**
     * 服务执行
     */
    EDIT, ADD, DELETE;


    private static final Map<String, LowCodeExecuteServiceEnum> mappings = new HashMap<>(PaasConstant.DEFAULT_INITIAL_CAPACITY);

    static {
        for (LowCodeExecuteServiceEnum httpMethod : values()) {
            mappings.put(httpMethod.name(), httpMethod);
        }
    }

    public static LowCodeExecuteServiceEnum get(@Nullable String method) {
        return (method != null ? mappings.get(method) : null);
    }

}
